<?php
/**
 * Created by PhpStorm.
 * User: kun
 * Date: 23/6/19
 * Time: 20:37
 */

namespace app\common\model;

use think\Model;

class User extends Base
{
    /**
     * 获取user Id数据
     * @param array $userIds
     * @return false|\PDOStatement|string|\think\Collection
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function getUserUserId($userIds = [])
    {
        $data = [
            'id' => ['in', implode(',', $userIds)],
            'status' => 1,
        ];

        $order = [
            'id' => 'desc',
        ];

        return $this->where($data)
            ->field(['id', 'username', 'image'])
            ->order($order)
            ->select();

    }

}